<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
       	<f:metadata>
    	   <f:viewParam name="group" value="#{groupBean.groupId}"/>
	    </f:metadata>
   <head><title>IGNORED</title></head>
   <body>
      <ui:composition template="/templates/masterLayout.xhtml">
         <ui:define name="windowTitle">
            Дисциплины группы <h:outputText value="#{groupBean.group.name}" />
         </ui:define>

         <ui:define name="content">
         	<p>Дисциплины группы <h:outputText value="#{groupBean.group.name}" /> набора <h:outputText value="#{groupBean.group.startYear}" /> года</p>
         	 <h:link outcome="publicMessages" includeViewParams="true" value="Сообщения группы">
   				<f:param name="group" value="#{groupBean.group.id}"/> 
			</h:link>
            <h:dataTable value="#{groupBean.disciplines}" var="discipline">
    		<h:column>
        	<f:facet name="header">
            <h:outputText value="Семестр" />
		        </f:facet>
        		<h:outputText value="#{discipline.term}" />
		    </h:column>
    		<h:column>
        	<f:facet name="header">
            <h:outputText value="Предмет" />
		        </f:facet>
        		<h:outputText value="#{discipline.subject.name}" />
		    </h:column>
		    <h:column>
        	<f:facet name="header">
            <h:outputText value="Лекции" />
		        </f:facet>
		        <h:link outcome="teacherDisciplines" value="#{discipline.lecturer.shortName}">
   					<f:param name="login" value="#{discipline.lecturer.user.login}"/> 
				</h:link>
		    </h:column>
		    <h:column>
		    <f:facet name="header">
            <h:outputText value="Практики" />
		        </f:facet>
		        <h:link outcome="teacherDisciplines" value="#{discipline.practiceTeacher.shortName}">
   					<f:param name="login" value="#{discipline.practiceTeacher.user.login}"/> 
				</h:link>
		    </h:column>
		    <h:column>
		    <f:facet name="header">
            <h:outputText value="Лабораторные" />
		        </f:facet>
        		<h:link outcome="teacherDisciplines" value="#{discipline.laboratoryTeacher.shortName}">
   					<f:param name="login" value="#{discipline.laboratoryTeacher.user.login}"/> 
				</h:link>
		    </h:column>
		    <h:column>
		    <f:facet name="header">
            <h:outputText value="Файлы" />
		        </f:facet>
		        <h:link outcome="disciplineFiles" value="Файлы">
   					<f:param name="group" value="#{discipline.group.id}"/>
        		<f:param name="term" value="#{discipline.term}"/>
        		<f:param name="subject" value="#{discipline.subject.id}"/> 
				</h:link>
		    </h:column>
		    <h:column rendered="#{authBean.loggedIn and authBean.currentUser.isAdministrator}">
        <f:facet name="header">
            <h:outputText value="" />
        </f:facet>
        <h:form>
        	<h:button value="Редактировать" outcome="editDiscipline">
        		<f:param name="group" value="#{discipline.group.id}"/>
        		<f:param name="term" value="#{discipline.term}"/>
        		<f:param name="subject" value="#{discipline.subject.id}"/>
        	</h:button>
        </h:form> 
    </h:column>
	</h:dataTable>
         </ui:define>
      </ui:composition>
   </body>
</html>